package com.ruoyi.questionBank.enums;

public enum QuestionTypeEnum {
    /** 单选*/
    RADIO(1),
    /** 多选*/
    CHECKBOX(2),
    /** 判断*/
    JUDGE(3),
    /** 填空*/
    FILL_IN(4),
    ;
    private int type;

    QuestionTypeEnum(int type) {
        this.type = type;
    }

    public int getType() {
        return type;
    }

    public static QuestionTypeEnum parse(int type) {
        for (QuestionTypeEnum typeEnum : QuestionTypeEnum.values()) {
            if (typeEnum.getType() == type) {
                return typeEnum;
            }
        }
        throw new IllegalArgumentException("Question Bank type undefined[" + type + "]");
    }
}
